package com.ljf.spring.sso;

import com.ljf.sso.SsoClientConfig;
import com.ljf.sso.SsoServerConfig;
import com.ljf.sso.SsoManager;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;

/**
 * 说明：sso注入
 *
 * @Auther: lijinfeng
 * @Date: 2024/4/24
 */
@ConditionalOnClass(SsoManager.class)
public class SsoBeanInject {

    /**
     * 注入配置Bean
     */
    @Autowired(required = false)
    public void setSsoServerConfig(SsoServerConfig serverConfig) {
        SsoManager.setServerConfig(serverConfig);
    }

    @Autowired(required = false)
    public void setSsoClientConfig(SsoClientConfig clientConfig) {
        SsoManager.setClientConfig(clientConfig);
    }
}
